package com.lagou.phone;

public class Test {

    public static void main(String[] args) {

        //使用多态调用
        //定义OldPhone对象,并且调用OldPhone从Phone类继承的抽象方法
        Phone p1 = new OldPhone("诺基亚","N95","13912345678");
        p1.call();
        p1.sendSms();

        System.out.println("-----------------------------------------");
        //定义NewPhone对象,并调用NewPhone从Phone类继承的抽象方法和从IPlay接口实现的方法
        Phone p2 = new NewPhone("华为","meta40","13987654321","保卫萝卜");
        p2.call();
        p2.sendSms();
        ((NewPhone) p2).playGame();
    }
}
